import request from '../../utils/request';

//新增数据
export let obserPost=(obserData:any)=>{
    return request.post("classes/ObserRole",obserData)
}
//更新数据
export let obserPut=(objectId:string,obserData:any)=>{
    return request.put(`classes/ObserRole/${objectId}`,obserData)
}
//获取数据
export const obserGet = () => {
    return request.get("classes/ObserRole")}
//获取数据-用于查询
interface Name {
    name?: Object
}
export const contGet = (name:string) => {
    let where: Name={
        name:{$regex:`${name}`,$options:"1"}
    };
    if(!name){
        delete where.name;
    }
    return request.get("classes/ObserRole",{
        params:{
            where
        }
    });
  };
  export const textGet = (page=1) => {
    let skip=(page-1)*4
    return request.get("classes/ObserRole",{
        params:{
            limit:4,
            skip,
            count:1
        }
    })}
  //删除数据
  export const obserDel = (objectId:string) => {
    return request.delete(`classes/ObserRole/${objectId}`);
  };
